/*
 * @Author: Zhouhai 497675647@qq.com
 * @Date: 2022-11-08 12:15:40
 * @LastEditors: Zhouhai 497675647@qq.com
 * @LastEditTime: 2022-11-15 17:13:27
 */
import request from '@/utils/request';
import type { CorpDomain } from '@/type.d/system';



// 查询公司信息列表
export async function getCorpList(params?: CorpDomain) {
  return request(`/system/corp/list`, {
    method: 'GET',
    params: params
  });
}

// 查询公司信息详细
export function getCorp(corpId: string) {
  return request(`/system/corp/${corpId}`, {
    method: 'GET',
  });
}

// 新增公司信息
export async function addCorp(params: CorpDomain) {
  return request('/system/corp', {
    method: 'POST',
    data: params,
  });
}

// 修改公司信息
export async function updateCorp(params: CorpDomain) {
  return request('/system/corp', {
    method: 'PUT',
    data: params,
  });
}

// 删除公司信息
export async function removeCorp(ids: string) {
  return request({
    url: `/system/corp/${ids}`,
    method: 'delete'
  })
}

// 修改公司状态
export async function changeStatus(params: CorpDomain) {
  return request('/system/corp/changeStatus', {
    method: 'PUT',
    data: params,
  });
}

// 查询下拉树结构
export function corpTreeSelect() {
  return request('/system/corp/treeselect', {
    method: 'get'
  })
}